//
//  SLInformationCollectionViewCell.m
//  StarLight
//
//  Created by apple on 16/7/30.
//  Copyright © 2016年 Duke.Wu. All rights reserved.
//

#import "SLInformationCollectionViewCell.h"

@interface SLInformationCollectionViewCell ()

@property (nonatomic ,strong) UILabel *titleName;

@property (nonatomic ,strong) UILabel *dateString;

@property (nonatomic ,strong) UILabel *timeString;

@end

@implementation SLInformationCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        [self addUI];
    }
    return self;
}
- (void)cellForData:(SLNewTopnews *)model
{
    self.titleName.text = model.gdtype;
    self.dateString.text = model.time;
}


- (void)addUI{
    
    
    [self addSubview:self.titleName];
    [self addSubview:self.dateString];
    [self addSubview:self.timeString];
    
    
    [self.titleName mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(21);
        make.centerX.equalTo(self);
        make.height.mas_equalTo(16);
    }];
    
    [self.dateString mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.titleName.mas_bottom).with.offset(13);
        make.centerX.equalTo(self);
        make.height.mas_equalTo(12);
    }];
    
}

- (UILabel *)titleName
{
    if (!_titleName) {
        _titleName = [UILabel new];
        _titleName.text = @"11111";
        _titleName.font = bFont(16);
        _titleName.textColor = RGBCOLOR(38, 38, 38);
    }
    return _titleName;
}

- (UILabel *)dateString
{
    if (!_dateString) {
        _dateString = [UILabel new];
        _dateString.text = @"07-09 8:12";
        _dateString.font = sFont(12);
        _dateString.textColor = RGBCOLOR(38, 38, 38);
    }
    return _dateString;
}

- (UILabel *)timeString
{
    if (!_timeString) {
        _timeString = [UILabel new];
        _timeString.text = @"8:12";
        _timeString.font = sFont(12);
        _timeString.textColor = RGBCOLOR(38, 38, 38);
    }
    return _timeString;
}



@end
